package pira.utils;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class Log {
	private FileWriter fw;
	
	public Log(String fileName, boolean add) {
		File f= new File(fileName);
		try {
			fw= new FileWriter(f, add);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public Log(String fileName) {
		File f= new File(fileName);
		try {
			fw= new FileWriter(f);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void write(String str) {
		try {
			fw.write(str);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	public void close() {
		try {
			this.fw.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
